#ifndef _DevicesLed_H_
#define _DevicesLed_H_



#define LED_RED             0x010
#define LED_GREEN           0x020
#define LED_YELLOW          0x040
#define LED_ALL             0xFFFF










#define LED_RED_RCC_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED_RED_GPIO_Port                    GPIOB
#define LED_RED_Pin                          GPIO_PIN_13

#define LED_GREEN_RCC_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED_GREEN_GPIO_Port                  GPIOB
#define LED_GREEN_Pin                        GPIO_PIN_14

#define LED_YELLOW_RCC_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED_YELLOW_GPIO_Port                 GPIOB
#define LED_YELLOW_Pin                       GPIO_PIN_15










typedef enum {
    LED_DISABLE = 0x1000,
    LED_ENABLE = 0x2000,
    LED_SLOW = 0x4000,
    LED_FAST = 0x8000,
} LedStateEnum;


typedef struct{
    uint16_t red;
    uint16_t green;
    uint16_t yellow;
}LedStateType;



extern LedStateType ex_typeLedState;










void vLedInit(void);
void vLedOpen(uint16_t ucNumber);
void vLedClose(uint16_t ucNumber);
void vLedRevesal(uint16_t ucNumber);

void vLedSetStatus(uint16_t ucNumber, uint32_t uiStatus);
void vLedShowStatus(uint16_t usName, uint32_t uiStatus, uint32_t uiCnt);


#define LED_OPEN()      vLedOpen(LED_ALL)
#define LED_CLOSE()     vLedClose(LED_ALL)
#define LED_REVESAL()   vLedRevesal(LED_ALL)


#endif
